package com.thesharegame.pricing;

import java.util.ArrayList;
import java.util.List;

import com.thesharegame.dal.DALService;
import com.thesharegame.model.Market;
import com.thesharegame.pricing.engine.PricingEngine;

public class PricingService {

	public PricingService(){
		PricingEngine engine = PricingEngine.getInstance();
		if(!engine.isRunning()){
			engine.start();
		}
	}
	
	public List<Market> getAllMarkets(){
		Market prototype = new Market();
		DALService service = new DALService();
		List<Object> objects = service.fetch(prototype);
		List<Market> results = new ArrayList<Market>();
		for(Object o : objects){
			results.add((Market)o);
		}
		return results;
	}
}
